3. cmdlets for SharePoint Foundation 2010
SharePoint Foundation 2010
contains over 240 SharePoint-related cmdlets. The exact number can be
found by typing the following command.
@(Get-Command -PSSnapin "Microsoft.SharePoint.PowerShell").count
The most common objects
that these cmdlets manipulate are the SPSite, SPServer, SPWeb,
SPBusinessDataCatalogue, and SPConfigurationDatabase objects. Because Windows
PowerShell is mainly an administrator’s tool, and these are the
components an administrator manages, this spread of cmdlet is not
unexpected. These cmdlets also can be found in SharePoint 2010, which
is built on top of SharePoint Foundation.
Note:
ON THE COMPANION MEDIA
The document “Microsoft SharePoint Foundation 2010 Cmdlet Reference” is
included on this book’s companion media. This document contains the
output that you would see if you typed the following command in the
SharePoint 2010 Management Shell.
PS C:\Users\Peter>Get-Command -PSSnapin Microsoft.SharePoint.PowerShell |
>>Sort Noun, Verb | Get-Help -detailed > CmdletHelp.txt
>><ENTER>
This command generates a list
of cmdlet Help topics that is sorted by noun. This list contains the
same Help for each cmdlet that you can view in the SharePoint 2010
Management Shell by typing the following command.
Get-Help <Cmdlet-Name> -detailed
The document contains
help information that was current at the time that the document was
produced. Microsoft recommends that you always check the online help to
find the latest information and examples. You can find the link to the
online version in the Related Links section when you use the Get-Help
command.
4. cmdlets for SharePoint 2010
If you use the same
Windows PowerShell command shown in the previous section to determine
the number of cmdlets available in SharePoint 2010, you will find that
there are more than 530 SharePoint-related cmdlets associated with
SharePoint 2010. Specifically, that is the number of cmdlets associated
with a full install of the Enterprise Edition of SharePoint 2010
without FAST Search installed. To identify the additional cmdlets that
SharePoint provides, Windows PowerShell can help again. On a computer
with both SharePoint Foundation and a version of SharePoint Server
installed, type the following command, changing the name of the
redirect file name to reflect the SharePoint installation.
PS C:\users\peter>Get-Command -PSSnapin "Microsoft.SharePoint.PowerShell" |
>> Sort noun, verb |group -Property noun -NoElement > cmdlet_sps.txt
>><Enter>
Copy the files to the same server and then type the following command.
PS C:\Users\Peter>Compare-Object -ReferenceObject $(Get-Content .\cmdlet_sps.txt) '
>>-DifferenceObject $(Get-Content .\cmdlet_spf.txt)
>><ENTER>
You will see output similar to the following example.
InputObject SideIndicator
----------- -------------
8 SPContentDatabase =>
3 PluggableSecurityTrimmer <=
3 SPAccessServiceApplica... <=
9 SPContentDatabase <=
5 SPContentDeploymentJob <=
4 SPContentDeploymentPath <=
4 SPDataConnectionFile <=
1 SPDataConnectionFileDe... <=
2 SPEnterpriseSearchAdmi... <=
3 SPEnterpriseSearchLang... <=
4 SPEnterpriseSearchMeta... <=
...
Only those objects that do not
appear on both installations, and those for which the count of the
number of cmdlets per object is different, will appear in this list.
The SideIndicator column indicates from which file the object with its
cmdlet count came.
In SharePoint 2010,
the most common objects that are manipulated by cmdlets are similar to
those in SharePoint Foundation. However, the main additional commands
available in SharePoint 2010 are the 131 cmdlets that help you manage
the search process. (There are only four cmdlets associated with
searches for SharePoint Foundation). Type the following command to
check this for yourself.
PS C:\Users\Peter>@(gcm -PSSnapin "Microsoft.SharePoint.PowerShell" |
>>where {$_.name -like "*search*"}).count
>><ENTER>
SharePoint 2010 contains
more application services than SharePoint Foundation, such as Excel
Services, InfoPath Services, Secure Storage, State Service, Microsoft
Visio, and PerformancePoint. Therefore, on a SharePoint Server farm, there are more cmdlets that you can use to create, manipulate, and delete application service objects.